import Vue from 'vue'
import Router from 'vue-router'
import BIndex from '@/components/BIndex'

Vue.use(Router)

//添加以下代码
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

export default new Router({
  routes: [
    {
      path: '/',
      name: 'DIndex',
      component: BIndex
    },{
      path: '/index',
      name: 'Index',
      component: BIndex
    },
  ]
})
